package com.cie2.janji.services;

import com.cie2.janji.entities.Promise;
import com.cie2.janji.entities.Promise.PromiseStatus;

public class PromiseStatusUIHelper {

	public String getImage(Promise promise) {
		if(promise.getStatus().equals(PromiseStatus.Broken))
			return "100broken.png";
		else if(promise.getStatus().equals(PromiseStatus.Keep))
			return "100keep.png";
		else {
			if(promise.getPercentage().intValue() == 25)
				return "25percent.png";
			if(promise.getPercentage().intValue() == 50)
				return "50percent.png";
			if(promise.getPercentage().intValue() == 75)
				return "75percent.png";
		}

		
		return "0percent.png";
	}
	
	public String getAlt(Promise promise) {
		if(promise.getStatus().equals(PromiseStatus.Broken))
			return "Broken";
		else if(promise.getStatus().equals(PromiseStatus.Keep))
			return "Keeped";
		else {
			if(promise.getPercentage().intValue() == 25)
				return "A Quarter has elapsed for ";
			if(promise.getPercentage().intValue() == 50)
				return "Half has elapsed for ";
			if(promise.getPercentage().intValue() == 75)
				return "3rd of Quarther has elapsed for ";
		}
		
		return "Zero progress";
	}
}
